package com.main.usermanagement.domain.user.aggregate;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.main.common.base.base.entity.BaseEntity;
import com.main.common.interfaces.AggregateRoot;
import com.main.usermanagement.domain.user.entity.UserInfo;
import com.main.usermanagement.domain.user.valueobject.Email;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author Lin 2025/03/12
 * @version 1.0.0
 * 用户聚合根
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AggregateRoot
@TableName("user")
public class User extends BaseEntity {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    @TableField(value = "name")
    private String name;
    @TableField(value = "email")
    private Email email;
    @TableField(value = "phone")
    private String phone;
    @TableField(value = "phone_code")
    private String phoneCode;
    @TableField(value = "status")
    private String status;
    @TableField(value = "wechat")
    private String wechat;
    @TableField(value = "direct_supervisor_id")
    private Long directSupervisorId;
    @TableField(value = "organization_atomic_id")
    private Long organizationAtomicId;

    @TableField(exist = false)
    private UserInfo userInfo;
//    private Set<UserIdentity> userIdentities; // 一个用户可以有多个身份
}
